<?php
class MvcPathTest extends PHPUnit_Framework_TestCase {


    private function _getMockCorrector () {
        $objMvcPathCorrector = $this->getMock(
            'K_MVC_PathCorrector',
            array('requestCorrect'),
            array(),
            '',
            false
        );

        $objMvcPathCorrector->expects($this->once())
                            ->method('requestCorrect')
                            ->will($this->returnArgument(0));

        return $objMvcPathCorrector;
    }


    public function test_Primary () {
        $objMockCorrector = $this->_getMockCorrector();

        $objMVCPath = new K_MVC_Path_Primary($objMockCorrector, 'xxx/yyy/zzz/www');

        $this->assertEquals('xxx', $objMVCPath->getController());
        $this->assertEquals('yyy', $objMVCPath->getMethod());
        $this->assertEquals(array('zzz','www'), $objMVCPath->getParams());
    }


    public function test_Slave () {
        $objMVCPath = new K_MVC_Path_Slave('<!--@ xxx/yyy/zzz/www -->');

        $this->assertEquals('xxx', $objMVCPath->getController());
        $this->assertEquals('yyy', $objMVCPath->getMethod());
        $this->assertEquals(array('zzz','www'), $objMVCPath->getParams());
    }

}